/**
 *@description:
 *@file: game_object.h
 *@author: snow-tyan
 *@email: zziywang@163.com
 *@date: 1 February 2023
 *@copyright: 2018-2022 AiRiA. All rights reserved.
 */

#pragma once

#include <glad/glad.h>
#include <glm/glm.hpp>
#include <memory>

namespace mygl {

class Texture2D;
class SpriteRenderer;

namespace game {

class GameObject {
 public:
  GameObject();
  GameObject(glm::vec2 pos, glm::vec2 size, std::shared_ptr<Texture2D> sprite,
             glm::vec3 color = glm::vec3(1.0f), glm::vec2 velocity = glm::vec2(0.0f));

  virtual ~GameObject();
  virtual void Draw(std::shared_ptr<SpriteRenderer> renderer);

 public:
  // Object state
  glm::vec2 position;
  glm::vec2 size;
  glm::vec2 velocity;
  glm::vec3 color;
  GLfloat rotation;
  bool is_solid;
  bool destroyed;

 protected:
  // Render state
  std::shared_ptr<Texture2D> sprite_;
};

}  // namespace game
}  // namespace mygl
